package model

import (
	"database/sql"
	"gorm.io/gorm"
)

type Order struct {
	gorm.Model
	OrderSn      string  `gorm:"column:order_sn;type:varchar(100);unique;not null;comment:订单编号"`
	UserId       int32   `gorm:"column:user_id;type:int(11);not null;comment:用户id"`
	GoodsId      int32   `gorm:"column:goods_id;type:int(11);not null;comment:商品id"`
	PayType      int32   `gorm:"column:pay_type;type:tinyint(1);default:1;comment:支付方式：1支付宝，2微信"`
	Status       int32   `gorm:"column:status;type:tinyint(1);default:0;comment:支付状态：0待支付，1已支付，2订单超时，3退款，4交易结束"`
	OrderMount   float64 `gorm:"column:order_mount;type:decimal(10,2);not null;comment:订单总金额"`
	PayTime      sql.NullTime
	Address      string `gorm:"column:address;type:varchar(100);not null;comment:收货地址"`
	SingerName   string `gorm:"column:singer_name;type:varchar(20);not null;comment:收货人"`
	SingerMobile string `gorm:"column:singer_mobile;type:char(11);not null;comment:收货号码"`
}
